//package com.externalapi;
//
//import java.io.FileInputStream;
//
//import android.app.Activity;
//import android.os.Bundle;
//import android.os.DropBoxManager.Entry;
//import android.util.Log;
//
//import java.io.*;
//
//public class DropBoxApi extends Activity {
//
//	/**
//	 * General information site:  https://www.dropbox.com/developers/app_info/318732
//	 */
//	final static private String APP_KEY = "bx9eufdsdzpbxs5";
//	final static private String APP_SECRET = "tz6vorkhj2xvfv1";
//	final static private AccessType ACCESS_TYPE = AccessType.INSERT_APP_ACCESS_TYPE;
//
//	private DropboxAPI<AndroidAuthSession> mDBApi;
//
//	@Override
//	protected void onCreate(Bundle savedInstanceState) {
//		super.onCreate(savedInstanceState);
//		AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
//		AndroidAuthSession session = new AndroidAuthSession(appKeys,
//				ACCESS_TYPE);
//		mDBApi = new DropboxAPI<AndroidAuthSession>(session);
//		mDBApi.getSession().startAuthentication(DropBoxApi.this);
//	}
//
//	@Override
//	protected void onResume() {
//		super.onResume();
//		if (mDBApi.getSession().authenticationSuccessful()) {
//			try {
//				// Required to complete auth, sets the access token on the
//				// session
//				mDBApi.getSession().finishAuthentication();
//
//				AccessTokenPair tokens = mDBApi.getSession()
//						.getAccessTokenPair();
//			} catch (IllegalStateException e) {
//				Log.i("DbAuthLog", "Error authenticating", e);
//			}
//		}
//	}
//
//	private void uploadFile() {
//		File file = new File("working-draft.txt");
//		FileInputStream inputStream = new FileInputStream(file);
//		Entry response = mDBApi.putFile("/magnum-opus.txt", inputStream,
//				file.length(), null, null);
//		Log.i("DbExampleLog", "The uploaded file's rev is: " + newEntry.rev);
//	}
//
//	private void listFolder() {
//		Entry existingEntry = mDBApi.metadata("/magnum-opus.txt", 1, null,
//				false, null);
//		Log.i("DbExampleLog", "The file's rev is now: " + existingEntry.rev);
//	}
//
//	private void downloadFile() {
//		File file = new File("/magnum-opus.txt");
//		FileOutputStream outputStream = new FileOutputStream(file);
//		DropboxFileInfo info = mDBApi.getFile("/magnum-opus.txt", null,
//				outputStream, null);
//		Log.i("DbExampleLog", "The file's rev is: " + info.getMetadata().rev);
//	}
//
//}
